package ptij.verifier.test.sdftest;

import ptolemy.actor.*;
import ptolemy.kernel.*;
import ptolemy.kernel.util.*;
import ptolemy.data.*;
import ptolemy.data.type.*;

public class test5 extends TypedAtomicActor {

   public test5(CompositeEntity container, String Name) throws
           NameDuplicationException, IllegalActionException  {
       super(container, Name);      
   
       plus = new TypedIOPort(this, "plus", true, false);
       input = new TypedIOPort(this, "input", true, false);
       output = new TypedIOPort(this, "output", false, true);       
   }

   public TypedIOPort plus;
   public TypedIOPort input;
   public TypedIOPort output;


   public void fire() throws IllegalActionException {

            n = n + 1;
/*
	    if(plus.hasToken(0) || (n > 10)) {
	        output.send(0, new Token());
            }
	    else {
	        System.out.println("merda");
	    }
	*/    

	    if(plus.hasToken(0) || metodo1()) {
	        output.send(0, new Token());
            }
	    else {
	        System.out.println("merda");
	    }
	    

   }
   
   private boolean metodo1() {
       if(n < 5) return true;
       return false;
   }
   
      int n = 0;
   
}
